Answer:

No. The PRINT statement is wrong. The words inside the quotes must include the is. The first item to print must be followed by a comma. It is very easy to overlook such small mistakes.

Here is the correct version of the program:

' Computing 12 times 12
PRINT "The square of 12 is", 12*12
END

Syntax Errors

If you tried to run the incorrect version of the program it would not work. You would see something on your screen like this:

(These notes have not explained how to run programs yet. Just pretend you tried to run the program). The gray box contains an error message that does not make much sense. To get rid of the box, hit the TAB key on your keyboard until the OK in the error message is selected, and then hit ENTER. (Unless you fix the mistake the error message will appear the next time you run the program.)

QBasic did not execute the PRINT statement because it has a Syntax Error. Syntax in programming languages means nearly the same as grammar means in human languages. It means "the rules for creating a correctly formed statement."

A statement without syntax errors is formed correctly. It might not make any sense. This is true with English also. The following is not an English sentence:

be you force may the with

It does not follow English syntax rules and is just a jumble of words. The following sentence has no syntax errors. But it does not make sense:

The distant corners softly remember grape soda.

QUESTION 12:

Is there a syntax error in the following program?

' Computing 12 times 12
PRINT The square of 12 is, 12*12
END